package org.xiaov.lunasql.engine.keyword;

import com.alibaba.druid.DbType;
import org.dromara.hutool.core.collection.set.SetUtil;

import java.util.Set;

/**
 * <p>
 * OracleKeywords
 * </p>
 *
 * @author lzq
 * @since 2024/12/23 10:25
 */
public class OracleKeywords implements DatabaseKeywords {

    private static final Set<String> KEY_WORDS = SetUtil.of(
            "ACCESS", "ADD", "ALL", "ALTER", "AND", "ANY", "AS", "ASC", "AUDIT", "BETWEEN", "BY",
            "CHAR", "CHECK", "CLUSTER", "COLUMN", "COMMENT", "COMPRESS", "CONNECT", "CREATE", "CURRENT",
            "DATE", "DECIMAL", "DEFAULT", "DELETE", "DESC", "DISTINCT", "DROP", "ELSE", "EXCLUSIVE", "EXISTS",
            "FILE", "FLOAT", "FOR", "FROM", "GRANT", "GROUP", "HAVING",
            "IDENTIFIED", "IMMEDIATE", "IN", "INCREMENT", "INDEX", "INITIAL", "INSERT", "INTEGER", "INTERSECT", "INTO", "IS",
            "LEVEL", "LIKE", "LOCK", "LONG", "MAXEXTENTS", "MINUS", "MLSLABEL", "MODE", "MODIFY",
            "NOAUDIT", "NOCOMPRESS", "NOT", "NOWAIT", "NULL", "NUMBER",
            "OF", "OFFLINE", "ON", "ONLINE", "OPTION", "OR", "ORDER", "PCTFREE", "PRIOR", "PRIVILEGES", "PUBLIC",
            "RAW", "RENAME", "RESOURCE", "REVOKE", "ROW", "ROWID", "ROWNUM", "ROWS",
            "SELECT", "SESSION", "SET", "SHARE", "SIZE", "SMALLINT", "START", "SUCCESSFUL", "SYNONYM", "SYSDATE",
            "TABLE", "THEN", "TO", "TRIGGER", "UID", "UNION", "UNIQUE", "UPDATE", "USER",
            "VALIDATE", "VALUES", "VARCHAR", "VARCHAR2", "VIEW", "WHENEVER", "WHERE", "WITH"
    );

    /**
     * 关键字集合
     *
     * @return Set
     */
    @Override
    public Set<String> getKeywords() {
        return KEY_WORDS;
    }

    /**
     * 关键字转义字符
     *
     * @return String
     */
    @Override
    public String getKeywordEscapeChar() {
        return "\"";
    }

    /**
     * 是否需要转换为小写
     *
     * @return boolean
     */
    @Override
    public boolean isLowerCase() {
        return false;
    }

    @Override
    public DbType registerType() {
        return DbType.oracle;
    }
}
